<!doctype html>
<html>

	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../css/mui.css" />
		<script src="../js/mui.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init()
		</script>
	</head>

	<body>
		<div class="mui-content">

			<ul class="mui-table-view">
				<!--<li class="mui-table-view-cell">
					<a class="mui-navigate-right">
                        Item 1
                    </a>
				</li>-->
			</ul>

		</div>
	</body>

</html>
<script>
	mui.ajax("/api/v1/region/list", {
		data: {
			paramStr: "{userName:" + sessionStorage.userName + ",token:" + sessionStorage.token +",pid:"+sessionStorage.area1+"}"
		},
		dataType: 'json',
		type: 'post',
		success: function(data) {
			var obj = eval('(' + data.data + ')');
			var ul = document.querySelector(".mui-table-view");
			var i;
			for (i in obj.info) {

				var li = document.createElement("li");
				li.className = "mui-table-view-cell";
				ul.appendChild(li);

				var a = document.createElement("a");
				a.className = "mui-navigate-right";
				li.appendChild(a);

				a.innerHTML = obj.info[i].name;
				li.id = obj.info[i].id;
			}

		},
		error: function(xhr, type, errorThrown) {
			//异常处理；
			mui.toast("未知错误");
		}
	});

	mui(".mui-table-view").on('tap', '.mui-table-view-cell', function() {
		//获取id
		var id = this.getAttribute("id");
		//传值给详情页面，通知加载新数据
		sessionStorage.area2=id;
		//打开新闻详情
		mui.openWindow({
			url: 'area3.html'
		});
	})
</script>